﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace _1._6._2015_EntityFramework.Models
{
    public class IndexViewModel
    {
        public List<OrderViewModel> Orders { get; set; }
    }
    public class OrderViewModel
    {
        public string Name { get; set; }
        public double Total { get; set; }
        public List<OrderItemsViewModel> OrderItems { get; set; }
        public DateTime OrderDate { get; set; }
    }


    public class OrderItemsViewModel
    {
        [DisplayName("Product Description")]
        public string ItemDescription { get; set; }
        public string Price { get; set; }
    }

    public class CreateItemViewModel
    {
        [Required]
        public string Description { get; set; }
        [DataType(DataType.Currency)]
        public decimal Price { get; set; }
    }

    public class ItemsViewModel
    {
        public List<ItemViewModel> Items { get; set; }
    }
    
    public class ItemViewModel
    {
        public int ItemId { get; set; }
        public string Description { get; set; }
        public decimal Price { get; set; }
    }
}